package com.google.mlkit.vision.docscan.pipeline.common;

import android.graphics.Bitmap;
import android.graphics.PointF;

public final class OpenCVUtils {
    static {
        try {
            System.loadLibrary("docscan_opencv_jni");
        } catch (Throwable ignored) {
        }
    }

    public static native int autoEnhanceNative(byte[] cfg, Bitmap in, Bitmap out);
    public static native boolean convertToBlackAndWhite(Bitmap in, Bitmap out);
    public static native float[] createInput(Bitmap bitmap, int i);
    public static native byte[] createInputQuantized(Bitmap bitmap, int i);
    /**
     * Deprecated in origin, but still provided by JNI. We keep the signature for compatibility.
     */
    public static native void enhanceColor(Bitmap in, float textLevel, boolean enableText,
                                           float lightnessLevel, boolean enableLightness,
                                           Bitmap out);
    public static native void warpAndCrop(Bitmap bitmap, PointF p1, PointF p2, PointF p3, PointF p4, Bitmap out);
}


